home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc1_2_x / reftrckr.sit / RT 1.6 / stack.txt < prev   
Text File  |  1990-04-19  |  27KB  |  891 lines

  1. -- stack: in.6
  2. -- format: 8 (HyperCard 1)
  3. -- flags: 0x5000 (can't delete)
  4. -- protect password hash: 0
  5. -- maximum user level: 5 (scripting)
  6. -- window: Rect(x1=0, y1=0, x2=0, y2=0)
  7. -- screen: Rect(x1=0, y1=0, x2=0, y2=0)
  8. -- card dimensions: w=0 h=0
  9. -- scroll: x=0 y=0
  10. -- background count: 3
  11. -- first background id: 30235
  12. -- card count: 5
  13. -- first card id: 136442
  14. -- list block id: 2516
  15. -- print block id: 7263
  16. -- font table block id: 0
  17. -- style table block id: 0
  18. -- free block count: 0
  19. -- free size: 0 bytes
  20. -- total size: 67360 bytes
  21. -- stack block size: 24064 bytes
  22. -- created by hypercard version: 0x01208000
  23. -- compacted by hypercard version: 0x01258000
  24. -- modified by hypercard version: 0x01258000
  25. -- opened by hypercard version: 0x01258000
  26. -- patterns[0]: 0x0000000000000000
  27. -- patterns[1]: 0x8000000008000000
  28. -- patterns[2]: 0x8800220088002200
  29. -- patterns[3]: 0x8888222288882222
  30. -- patterns[4]: 0x88AA22AA88AA22AA
  31. -- patterns[5]: 0xCCAA33AACCAA33AA
  32. -- patterns[6]: 0xEEAABBAAEEAABBAA
  33. -- patterns[7]: 0xEEBBBBEEEEBBBBEE
  34. -- patterns[8]: 0xFFBBFFEEFFBBFFEE
  35. -- patterns[9]: 0xFFBBFFFFFFBBFFFF
  36. -- patterns[10]: 0x8010022001084004
  37. -- patterns[11]: 0xFFFFFFFFFFFFFFFF
  38. -- patterns[12]: 0x8822882288228822
  39. -- patterns[13]: 0x1122448811224488
  40. -- patterns[14]: 0xC4800C6843023026
  41. -- patterns[15]: 0xB130031BD8C00C8D
  42. -- patterns[16]: 0xAA00AA00AA00AA00
  43. -- patterns[17]: 0x8822552288225522
  44. -- patterns[18]: 0x8855225588552255
  45. -- patterns[19]: 0x77DD77DD77DD77DD
  46. -- patterns[20]: 0x8000000000000000
  47. -- patterns[21]: 0xAA55AA55AA55AA55
  48. -- patterns[22]: 0x038448300C020101
  49. -- patterns[23]: 0x8244394482010101
  50. -- patterns[24]: 0x8814224188412214
  51. -- patterns[25]: 0x8080413E080814E3
  52. -- patterns[26]: 0x22048C7422179810
  53. -- patterns[27]: 0xBE808808EB088880
  54. -- patterns[28]: 0x25C8328964244C92
  55. -- patterns[29]: 0xA29C41BE2AC914EB
  56. -- patterns[30]: 0x40A00000040A0000
  57. -- patterns[31]: 0x8040200002040800
  58. -- patterns[32]: 0xAA00800088008000
  59. -- patterns[33]: 0xFF80808080808080
  60. -- patterns[34]: 0x081C22C180010204
  61. -- patterns[35]: 0xFF808080FF080808
  62. -- patterns[36]: 0xF87422478F172271
  63. -- patterns[37]: 0xBF00BFBFB0B0B0B0
  64. -- patterns[38]: 0xFF7FBE5DA2418000
  65. -- patterns[39]: 0xFAF5FAF5A050A050
  66. -- checksum: 0x0
  67. ----- HyperTalk script -----
  68. on openStack
  69.   global var, fn, MarkedCard, menu1, menu2, TextArrowStatus
  70.   if the version < 1.2 then
  71.     answer "This stack needs HyperCard version 1.2."
  72.     doMenu "Quit HyperCard"
  73.   end if
  74.   set cursor to 4
  75.   set userlevel to 5
  76.   hide msg
  77.   set blindTyping to true
  78.   set textArrows to false
  79.   put "off" into TextArrowStatus
  80.  
  81.   put NewMenu("Articles","About Ref Tracker.../?", "(-","Find Again/A","Store This Article/S", "Go to Stored Article/G", "(-","To Clipboard/K", "(-","To Disk/D","Close Disk File", "(-","Read In Articles/I","Write Out Articles/W") into menu1
  82.  
  83.   put NewMenu("Operations","Clear Special Clipboard", "Write Clipboard To Disk","Text Arrows/5","(-", "Delete This Card/L","Make A New Card/Y", "(-","Sort The Stack/J","Compact The Stack/U", "Eliminate Duplicates/E") into menu2
  84.  
  85.   global toBeFound
  86.   if toBeFound is empty then EnableMenu 1, 3, false
  87.   EnableMenu 1, 10, false
  88.   EnableMenu 2, 2, false
  89.  
  90.   global screenSize
  91.   put item 2 of the screenRect into screenTop
  92.   if top of card window > screenTop + 20 then
  93.     put "big" into screenSize
  94.     titleBar hide
  95.     put empty into tempFieldScript
  96.     set loc of msg to 22,366
  97.   else
  98.     put "small" into screenSize
  99.     hide menuBar
  100.     put "on mouseEnter" & return into tempFieldScript
  101.     put "show menuBar" & return after tempFieldScript
  102.     put "end mouseEnter" & return & return after tempFieldScript
  103.     put "on mouseLeave" & return after tempFieldScript
  104.     put "hide menuBar" & return after tempFieldScript
  105.     put "end mouseLeave" & return after tempFieldScript
  106.     set loc of msg to 22,300
  107.   end if
  108.  
  109.   set lockScreen to true
  110.   set the script of bkgnd field id 85 of cd 2 to tempFieldScript
  111.   set the name of bkgnd button id 79 of cd 2 to "Author"
  112.   set hilite of bkgnd button id 88 of cd 2 to false
  113.   put empty into cd field "HoldingArea" of cd "Help Card"
  114.   set lockScreen to false
  115.  
  116.   put "" into var
  117.   put "" into fn
  118.   put the number of cds of bkgnd id 30235 into cd field "number of cards" of cd "Help Card"
  119.   put cd field id 16 of cd "Help Card" into MarkedCard
  120.  
  121. end openStack
  122.  
  123. on openCard
  124.   global tempThing, exempt
  125.   hide msg
  126.   if the short name of this cd is "Help Card" or the short name of this cd is "TitleCard" or exempt is "Yes" then
  127.     put "No" into exempt
  128.     exit openCard
  129.   end if
  130.   put tempThing into bkgnd field id 80
  131. end openCard
  132.  
  133. on closeCard
  134.   global PriorCard, tempThing
  135.   put the short name of this cd into PriorCard
  136.   screenCheck
  137.   if the short name of this cd is "Help Card" or the short name of this cd is "TitleCard" then
  138.     exit closeCard
  139.   end if
  140.   put bkgnd field "Thing" into tempThing
  141.   put empty into bkgnd field id 80
  142. end closeCard
  143.  
  144. on closeStack
  145.   set cursor to 4
  146.   put the number of cds of background id 30235 into cd field "number of cards" of cd "Help Card"
  147.   global menu1, menu2
  148.   put DeleteMenu(menu1) into menu1
  149.   put DeleteMenu(menu2) into menu2
  150. end closeStack
  151.  
  152. on enterKey
  153.   send mouseUp to bkgnd button id 81
  154. end enterKey
  155.  
  156. ------------------------------------------------------------------------
  157. --      The ΓÇ£doMenuΓÇ¥ routines Appear Below in Alphabetical Order      --
  158. ------------------------------------------------------------------------
  159.  
  160. on doMenu which
  161.  
  162.   if which is "About Ref Tracker..." then
  163.     screenCheck
  164.     AboutRefTracker
  165.  
  166.   else if which is "Back" then
  167.     screenCheck
  168.     DoBack
  169.  
  170.   else if which is "Clear Special Clipboard" then
  171.     screenCheck
  172.     clearClip
  173.  
  174.   else if which is "Close Disk File" then
  175.     screenCheck
  176.     CloseDiskFile
  177.  
  178.   else if which is "Compact The Stack" then
  179.     screenCheck
  180.     compactTheStack
  181.  
  182.   else if which is "Delete This Card" then
  183.     screenCheck
  184.     DoDeleteThisCard
  185.  
  186.   else if which is "Eliminate Duplicates" then
  187.     screenCheck
  188.     DoDeDup
  189.  
  190.   else if which is "Find..." then
  191.     screenCheck
  192.     send mouseUp to bkgnd button id 33
  193.  
  194.   else if which is "Find Again" then
  195.     screenCheck
  196.     send mouseUp to bkgnd button id 72
  197.  
  198.   else if which is "Go to Stored Article" then
  199.     screenCheck
  200.     set cursor to signal
  201.     global MarkedCard
  202.     visual effect dissolve
  203.     go to MarkedCard
  204.  
  205.   else if which is "Help" then
  206.     screenCheck
  207.     AboutRefTracker
  208.  
  209.   else if which is "Last" then
  210.     screenCheck
  211.     set cursor to Signal
  212.     go to last cd of this bkgnd
  213.  
  214.   else if which is "Make A New Card" then
  215.     screenCheck
  216.     DoMakeNewCard
  217.  
  218.   else if which is "Next" then
  219.     screenCheck
  220.     visual effect scroll left
  221.     go next cd of this bkgnd
  222.  
  223.   else if which is "Prev" then
  224.     screenCheck
  225.     visual effect scroll right
  226.     go prev cd of this bkgnd
  227.  
  228.   else if which is "Read In Articles" then
  229.     screenCheck
  230.     readInNewArticles
  231.  
  232.   else if which is "Sort The Stack" then
  233.     screenCheck
  234.     SortIt
  235.  
  236.   else if which is "Store This Article" then
  237.     screenCheck
  238.     set cursor to signal
  239.     global MarkedCard
  240.     put the name of this cd into MarkedCard
  241.     put MarkedCard into cd field id 16 of cd "Help Card"
  242.     wait 1 second
  243.  
  244.   else if which is "Text Arrows" then
  245.     screenCheck
  246.     adjustTextArrows
  247.  
  248.   else if which is "To Clipboard" then
  249.     screenCheck
  250.     send mouseUp to bkgnd button id 83
  251.  
  252.   else if which is "To Disk" then
  253.     screenCheck
  254.     send mouseUp to bkgnd button id 40
  255.  
  256.   else if which is "Write Clipboard To Disk" then
  257.     screenCheck
  258.     writeClipOut
  259.  
  260.   else if which is "Write Out Articles" then
  261.     screenCheck
  262.     PreliminaryWriteOut
  263.  
  264.   else if which is "MockWrite" or which is "Key Caps" or which is "DAleks" then
  265.     pass doMenu
  266.  
  267.   else
  268.     screenCheck
  269.     pass doMenu
  270.   end if
  271.  
  272. end doMenu
  273.  
  274. ------------------------------------------------------------------------
  275. --Main Routines (other than doMenu) Appear Below in Alphabetical Order--
  276. ------------------------------------------------------------------------
  277.  
  278. on AboutRefTracker
  279.   answer "Reference Tracker Version 1.6" & return & "        January 1st, 1990" & return & "      ┬⌐ 1990 by Ian Neath" & return & "       From Owl Software" with "Help" or "Ok"
  280.   if it is "Help" then
  281.     send mouseUp to bkgnd button id 41
  282.   end if
  283. end AboutRefTracker
  284.  
  285. on adjustTextArrows
  286.   global TextArrowStatus
  287.   if TextArrowStatus is "on" then
  288.     set cursor to TAoff
  289.     put "off" into TextArrowStatus
  290.     set textArrows to false
  291.     CheckMenu 2, 3, false
  292.     wait 1 sec
  293.   else
  294.     set cursor to TAon
  295.     put "on" into TextArrowStatus
  296.     set textArrows to true
  297.     CheckMenu 2, 3, true
  298.     wait 1 sec
  299.   end if
  300. end adjustTextArrows
  301.  
  302. on arrowKey whichKey
  303.   global TextArrowStatus
  304.   if TextArrowStatus is "on" then
  305.     pass arrowKey
  306.   else
  307.  
  308.     if whichKey is "up" and the optionKey is down then
  309.       set cursor to signal
  310.       global MarkedCard
  311.       put the name of this cd into MarkedCard
  312.       put MarkedCard into cd field id 16 of cd "Help Card"
  313.       wait 1 second
  314.  
  315.     else if whichKey is "up" and the optionKey is not down then
  316.       set cursor to signal
  317.       global MarkedCard
  318.       visual effect dissolve
  319.       go to MarkedCard
  320.  
  321.     else if whichKey is "down" then
  322.       set cursor to signal
  323.       global PriorCard
  324.       if PriorCard is empty or the name of this cd is "Help Card" or PriorCard is "Help Card" then
  325.         exit arrowKey
  326.       else
  327.         visual effect dissolve
  328.         go to PriorCard
  329.       end if
  330.  
  331.     else if whichKey is "right" then
  332.       go next cd of this bkgnd
  333.     else if whichKey is "left" then
  334.       go prev cd of this bkgnd
  335.     end if
  336.   end if
  337. end arrowKey
  338.  
  339. on clearClip
  340.   set cursor to 4
  341.   global CommIn
  342.   put empty into CommIn
  343.   put empty into cd field "HoldingArea" of cd "Help Card"
  344.   EnableMenu 2, 2, false
  345. end clearClip
  346.  
  347. on closeDiskFile
  348.   global fn, var,CommIn
  349.   if fn is empty then
  350.     exit closeDiskFile
  351.   end if
  352.   answer return & "Close file " & quote & fn & quote & " ?" with "No" or "Yes"
  353.   if it is "Yes" then
  354.     put fn into tempfn
  355.     put "" into fn
  356.     put "" into var
  357.     put "" into CommIn
  358.     close file tempfn
  359.     answer "File" && quote & tempfn & quote && "closed.  Trying to write more information to this file will erase its contents." with "OK"
  360.     EnableMenu 1, 10, false
  361.   end if
  362. end closeDiskFile
  363.  
  364. on compactTheStack
  365.   answer return & "About to compact the stack:" with "Cancel" or "Proceed"
  366.   if it is "Proceed" then
  367.     put msg into temp
  368.     put "Compacting the stack..."
  369.     doMenu "Compact Stack"
  370.     put temp
  371.     hide msg
  372.   else
  373.     exit compactTheStack
  374.   end if
  375. end compactTheStack
  376.  
  377. on convertJournal
  378.   global JA
  379.   if char 1 of JA is "J" then
  380.     if char 1 of JA is "J" and char 2 of JA is "E" and char 3 of JA is "P" then
  381.       if char 4 of JA is "," then
  382.         put "" into char 3 of JA
  383.         put "" into char 2 of JA
  384.         put "" into char 1 of JA
  385.         put "Journal of Experimental Psychology" before JA
  386.       else if char 4 of JA is ":" and char 7 of JA is "L" then
  387.         put "" into char 9 of JA
  388.         put "" into char 8 of JA
  389.         put "" into char 7 of JA
  390.         put "" into char 6 of JA
  391.         put "" into char 5 of JA
  392.         put "" into char 4 of JA
  393.         put "" into char 3 of JA
  394.         put "" into char 2 of JA
  395.         put "" into char 1 of JA
  396.         put "Journal of Experimental Psychology:  Learning, Memory and Cognition" before JA
  397.       else if char 4 of JA is ":" and char 7 of JA is "G" then
  398.         put "" into char 3 of JA
  399.         put "" into char 2 of JA
  400.         put "" into char 1 of JA
  401.         put "Journal of Experimental Psychology" before JA
  402.       else if char 4 of JA is ":" and char 8 of JA is "L" then
  403.         put "" into char 9 of JA
  404.         put "" into char 8 of JA
  405.         put "" into char 7 of JA
  406.         put "" into char 6 of JA
  407.         put "" into char 5 of JA
  408.         put "" into char 4 of JA
  409.         put "" into char 3 of JA
  410.         put "" into char 2 of JA
  411.         put "" into char 1 of JA
  412.         put "Journal of Experimental Psychology:  Human Learning and Memory" before JA
  413.       else if char 4 of JA is ":" and char 8 of JA is "P" then
  414.         put "" into char 9 of JA
  415.         put "" into char 8 of JA
  416.         put "" into char 7 of JA
  417.         put "" into char 6 of JA
  418.         put "" into char 5 of JA
  419.         put "" into char 4 of JA
  420.         put "" into char 3 of JA
  421.         put "" into char 2 of JA
  422.         put "" into char 1 of JA
  423.         put "Journal of Experimental Psychology:  Human Perception and Performance" before JA
  424.       else if char 4 of JA is ":" and char 7 of JA is "M" then
  425.         put "" into char 3 of JA
  426.         put "" into char 2 of JA
  427.         put "" into char 1 of JA
  428.         put "Journal of Experimental Psychology" before JA
  429.       end if
  430.     else if char 1 of JA is "J" and char 2 of JA is "M" then
  431.       put "" into char 3 of JA
  432.       put "" into char 2 of JA
  433.       put "" into char 1 of JA
  434.       put "Journal of Memory and Language" before JA
  435.     else if char 1 of JA is "J" and char 2 of JA is "V" then
  436.       put "" into char 5 of JA
  437.       put "" into char 4 of JA
  438.       put "" into char 3 of JA
  439.       put "" into char 2 of JA
  440.       put "" into char 1 of JA
  441.       put "Journal of Verbal Learning and Verbal Behavior" before JA
  442.     else if char 1 of JA is "J" and char 2 of JA is "A" and char 3 of JA is "S" and char 4 of JA is "A" then
  443.       put "" into char 4 of JA
  444.       put "" into char 3 of JA
  445.       put "" into char 2 of JA
  446.       put "" into char 1 of JA
  447.       put "Journal of the Acoustical Society of America" before JA
  448.     end if
  449.   else if char 1 of JA is "M" and char 2 of JA is "&" then
  450.     put "" into char 3 of JA
  451.     put "" into char 2 of JA
  452.     put "" into char 1 of JA
  453.     put "Memory and Cognition" before JA
  454.   else if char 1 of JA is "P" then
  455.     if char 2 of JA is "&" then
  456.       put "" into char 3 of JA
  457.       put "" into char 2 of JA
  458.       put "" into char 1 of JA
  459.       put "Perception and Psychophysics" before JA
  460.     else if char 7 of JA is "R" then
  461.       put "" into char 9 of JA
  462.       put "" into char 8 of JA
  463.       put "" into char 7 of JA
  464.       put "" into char 6 of JA
  465.       put "" into char 5 of JA
  466.       put "" into char 4 of JA
  467.       put "" into char 3 of JA
  468.       put "" into char 2 of JA
  469.       put "" into char 1 of JA
  470.       put "Psychological Review" before JA
  471.     else if char 7 of JA is "B" then
  472.       put "" into char 10 of JA
  473.       put "" into char 9 of JA
  474.       put "" into char 8 of JA
  475.       put "" into char 7 of JA
  476.       put "" into char 6 of JA
  477.       put "" into char 5 of JA
  478.       put "" into char 4 of JA
  479.       put "" into char 3 of JA
  480.       put "" into char 2 of JA
  481.       put "" into char 1 of JA
  482.       put "Psychological Bulletin" before JA
  483.     else if char 2 of JA is "S" and char 3 of JA is "," then
  484.       put "" into char 2 of JA
  485.       put "" into char 1 of JA
  486.       put "Psychological Science" before JA
  487.     end if
  488.   else if char 1 of JA is "A" and char 2 of JA is "J" and char 3 of JA is "P" then
  489.     put "" into char 3 of JA
  490.     put "" into char 2 of JA
  491.     put "" into char 1 of JA
  492.     put "American Journal of Psychology" before JA
  493.   else if char 1 of JA is "A" and char 2 of JA is "P" and char 3 of JA is "," then
  494.     put "" into char 2 of JA
  495.     put "" into char 1 of JA
  496.     put "American Psychologist" before JA
  497.   else
  498.     if char 1 of JA is "Q" and char 2 of JA is "J" then
  499.       put "" into char 4 of JA
  500.       put "" into char 3 of JA
  501.       put "" into char 2 of JA
  502.       put "" into char 1 of JA
  503.       put "Quarterly Journal of Experimental Psychology" before JA
  504.     end if
  505.   end if
  506. end convertJournal
  507.  
  508. on DoBack
  509.   global PriorCard
  510.   if PriorCard is empty or the name of this cd is "Help Card" or PriorCard is "Help Card" then
  511.     exit DoBack
  512.   else
  513.     set cursor to Signal
  514.     visual effect dissolve
  515.     go to PriorCard
  516.   end if
  517. end DoBack
  518.  
  519. on DoDeDup
  520.   answer "Eliminate Duplicates:" & return & "Is the stack sorted by ΓÇÿAuthorΓÇÖ?" with "Cancel" or "No" or "Yes"
  521.   if it is "Cancel" then
  522.     exit DoDeDup
  523.   else if it is "No" then
  524.     answer return & "Sort cards alphabetically by ΓÇÿAuthorΓÇÖ and then Eliminate Duplicates?" with "Cancel" or "Proceed"
  525.     if it is not "Cancel" then
  526.       sort by field "Author" & field "Title"
  527.     else
  528.       exit DoDeDup
  529.     end if
  530.   end if
  531.  
  532.   global NewC, OldC, NewT, OldT, NewA, OldA
  533.   put msg into temp
  534.   put "Searching for possible duplicates...  (Command-Period to terminate)"
  535.   put the number of cds of bkgnd id 30235 into numofcards
  536.   add -2 to numofcards
  537.   put 2 into OldC
  538.   put 3 into NewC
  539.   put word 1 of bkgnd field "Author" of cd OldC into OldA
  540.   put word 2 of bkgnd field "Author" of cd OldC after OldA
  541.   put word 5 of bkgnd field "Author" of cd OldC after OldA
  542.   put word 1 of bkgnd field "Title" of cd OldC into OldT
  543.   put word 4 of bkgnd field "Title" of cd OldC after OldT
  544.   put last word of bkgnd field "Title" of cd OldC after OldT
  545.  
  546.   repeat forever
  547.     set cursor to busy
  548.     put word 1 of bkgnd field "Author" of cd NewC into NewA
  549.     put word 2 of bkgnd field "Author" of cd NewC after NewA
  550.     put word 5 of bkgnd field "Author" of cd NewC after NewA
  551.     put word 1 of bkgnd field "Title" of cd NewC into NewT
  552.     put word 4 of bkgnd field "Title" of cd NewC after NewT
  553.     put last word of bkgnd field "Title" of cd NewC after NewT
  554.     if NewA = OldA and NewT = OldT then
  555.       beep
  556.       go to cd OldC
  557.       answer return & "This and the next card may be duplicates" with "Show Next"
  558.       go to cd NewC
  559.       answer return & "Delete which card?" with "1st" or "2nd" or "Neither"
  560.       if it is "1st" then
  561.         go prev
  562.         DoDeleteThisCard
  563.       else if it is "2nd" then
  564.         DoDeleteThisCard
  565.       end if
  566.       put msg
  567.     end if
  568.     put NewC into OldC
  569.     put NewA into OldA
  570.     put NewT into OldT
  571.     add 1 to NewC
  572.     if NewC > numofcards then exit repeat
  573.   end repeat
  574.   put temp
  575.   hide msg
  576.   beep
  577.   answer return & "End of de-duplicating." with "Ok"
  578. end DoDeDup
  579.  
  580. on DoDeleteThisCard
  581.   answer return & "About to delete this card and erase all of the information permanently:" with "Proceed" or "Cancel"
  582.   if it is "Proceed" then
  583.     set cursor to 4
  584.     domenu "Delete Card"
  585.     put the number of cds of bkgnd id 30235 into cd field "number of cards" of cd "Help Card"
  586.   end if
  587. end DoDeleteThisCard
  588.  
  589. on DoMakeNewCard
  590.   set cursor to 4
  591.   doMenu "New Card"
  592.   put "New" into bkgnd field "Status"
  593.   get the short date
  594.   put it into bkgnd field id 82
  595.   put the number of cds of bkgnd id 30235 into cd field "number of cards" of cd "Help Card"
  596.   put "?" into bkgnd field id 73
  597. end DoMakeNewCard
  598.  
  599. on FindIt
  600.   set cursor to RegFind
  601.   set lockscreen to true
  602.   global toBeFound,howToSearch,whereToSearch,PriorCard
  603.   put the name of this cd into tempPriorCard
  604.   if toBeFound is empty then
  605.     EnableMenu 1, 3, false
  606.   else
  607.     EnableMenu 1, 3, true
  608.   end if
  609.  
  610.   if whereToSearch is "All" and howToSearch is empty then
  611.     put "Find" && quote & toBeFound & quote
  612.   else if whereToSearch is "All" and howToSearch is "whole" then
  613.     put "Find whole" && quote & toBeFound & quote
  614.   else if howToSearch is empty and whereToSearch is not "All" then
  615.     put "Find" && quote & toBeFound & quote && "in field" && whereToSearch
  616.   else if howToSearch is "whole" and whereToSearch is not "All" then
  617.     put "Find whole" && quote & toBeFound & quote && "in field" && whereToSearch
  618.   end if
  619.  
  620.   hide msg
  621.   type return
  622.  
  623.   if the short name of this cd is "Help Card" then
  624.     go next cd
  625.     type return
  626.   end if
  627.  
  628.   if the result is not empty then
  629.     put toBeFound into bkgnd field id 80
  630.     set lockScreen to false
  631.     if whereToSearch is "All" then
  632.       answer return & "There are no occurrences of ΓÇÿ" & toBeFound & "ΓÇÖ in any field." with "Ok"
  633.     else
  634.       answer return & "There are no occurrences of ΓÇÿ" & toBeFound & "ΓÇÖ in the ΓÇÿ" & whereToSearch & "ΓÇÖ field." with "Ok"
  635.     end if
  636.     EnableMenu 1, 3, false
  637.   else
  638.     put toBeFound into bkgnd field id 80
  639.     set lockScreen to false
  640.     global beenThere
  641.     put the number of this cd into beenThere
  642.     put tempPriorCard into PriorCard
  643.   end if
  644.  
  645. end FindIt
  646.  
  647. on helpButton message,msgloc
  648.   global screensize
  649.   put msg into temp
  650.   set cursor to Help
  651.   if msgloc is not empty and screensize is "Small" then
  652.     set loc of msg to 22,220
  653.   end if
  654.   put message
  655.   repeat while the shiftKey is down
  656.   end repeat
  657.   put temp
  658.   hide msg
  659.   if screensize is "Small" then set loc of msg to 22,300
  660. end helpButton
  661.  
  662. on PreliminaryWriteOut
  663.   answer return & "Write out articles based on ΓÇÿstatusΓÇÖ or ΓÇÿdateΓÇÖ?" with "Cancel" or "Date" or "Status"
  664.   if it is "Cancel" then
  665.     exit PreliminaryWriteOut
  666.   else if it is "Status" then
  667.     writeOutNewArticles
  668.   else
  669.     answer return & "Is the stack sorted by date ?" with "No" or "Yes"
  670.     if it is "No" then
  671.       answer return & "The stack must be sorted by date for this procedure to work." with "Ok"
  672.       exit PreliminaryWriteOut
  673.     else
  674.       writeOutByDate
  675.     end if
  676.   end if
  677. end PreliminaryWriteOut
  678.  
  679. on quickFind
  680.   set cursor to quickFind
  681.   hide msg
  682.   set lockscreen to true
  683.   global toBeFound,howToSearch,whereToSearch,PriorCard,beenThere
  684.   if toBeFound is empty then
  685.     EnableMenu 1, 3, false
  686.   else
  687.     EnableMenu 1, 3, true
  688.   end if
  689.   set the name of bkgnd button id 79 to whereToSearch
  690.   put the name of this cd into tempPriorCard
  691.   put the number of this cd into beenThere
  692.   go next cd of this bkgnd
  693.   put empty into bkgnd field id 80
  694.  
  695.   if howToSearch is "whole" then
  696.     put "Find whole" && quote & toBeFound & quote && "in field" && whereToSearch
  697.   else
  698.     put "Find" && quote & toBeFound & quote && "in field" && whereToSearch
  699.   end if
  700.  
  701.   hide msg
  702.   put bkgnd field id 80 into tempToBeFound
  703.   put empty into bkgnd field id 80
  704.   type return
  705.  
  706.   if the short name of this cd is "Help Card" then
  707.     go next cd
  708.     type return
  709.   end if
  710.  
  711.   if the result is not empty or the number of this cd is beenThere then
  712.     put tempToBeFound into bkgnd field id 80
  713.     go to tempPriorCard
  714.     set lockScreen to false
  715.     beep
  716.     answer "There are no more occurrences of ΓÇÿ" & toBeFound & "ΓÇÖ in the field ΓÇÿ" & whereToSearch & "ΓÇÖ." with "Ok"
  717.     EnableMenu 1, 3, false
  718.   else
  719.     put ToBeFound into bkgnd field id 80
  720.     set lockScreen to false
  721.     put tempPriorCard into PriorCard
  722.   end if
  723. end quickFind
  724.  
  725. on readInNewArticles
  726.  
  727.   put the number of cds of bkgnd id 30235 into numofcards
  728.   put "TEXT" into type
  729.   get Filename(type)
  730.   if it is empty then
  731.     exit readInNewArticles
  732.   else
  733.     put it into upf
  734.   end if
  735.   open file upf
  736.  
  737.   repeat forever
  738.     read from file upf until return
  739.     if it is not empty then
  740.       put it into temp
  741.       DoMakeNewCard
  742.       add 1 to numofcards
  743.       put temp into field "Author"
  744.       read from file upf until return
  745.       put it into field "Title"
  746.       read from file upf until return
  747.       put it into field "Source"
  748.       read from file upf until return
  749.       put it into field "Comments"
  750.       read from file upf until return
  751.       put it into field "Keywords"
  752.       put "?" into bkgnd field "Possession"
  753.     else
  754.       exit repeat
  755.     end if
  756.   end repeat
  757.  
  758.   close file upf
  759.   put "Last Update:  " & the short date into cd field "LastUpdated" of cd "Help Card"
  760.   answer return & "All new information read in." with "Ok"
  761.  
  762. end readInNewArticles
  763.  
  764. on screenCheck
  765.   global screenSize
  766.   if screenSize is "small" then
  767.     hide menuBar
  768.   end if
  769. end screenCheck
  770.  
  771. on sortIt
  772.   answer return & "Sort cards by ΓÇÿAuthorΓÇÖ or by ΓÇÿDateMadeΓÇÖ ?" with "Other" or "DateMade" or "Author"
  773.   if it is "DateMade" then
  774.     put msg into temp
  775.     put "Sorting by ΓÇÿDateMadeΓÇÖ..."
  776.     sort descending datetime by field "DateMade"
  777.     put temp
  778.     hide msg
  779.     exit sortIt
  780.   else if it is "Author" then
  781.     put msg into temp
  782.     put "Sorting by ΓÇÿAuthorΓÇÖ..."
  783.     sort by field "Author" & field "Title"
  784.     put temp
  785.     hide msg
  786.     exit sortIt
  787.   else if it is "Other" then
  788.     answer return & "Sort cards by ΓÇÿSourceΓÇÖ or by ΓÇÿStatusΓÇÖ ?" with "Cancel" or "Source" or "Status"
  789.     if it is "Source" then
  790.       put msg into temp
  791.       put "Sorting by ΓÇÿSourceΓÇÖ..."
  792.       sort by field "Source"
  793.       put temp
  794.       hide msg
  795.       exit sortIt
  796.     else if it is "Status" then
  797.       put msg into temp
  798.       put "Sorting by ΓÇÿStatusΓÇÖ..."
  799.       sort by field "Status"
  800.       put temp
  801.       hide msg
  802.       exit sortIt
  803.     end if
  804.   end if
  805. end sortIt
  806.  
  807. on writeClipOut
  808.   set cursor to 4
  809.   put "Heap oΓÇÖ Clippings" into shortFile
  810.   put NewFileName( "Save file as:",(shortFile)) into fn
  811.   if fn is empty or char 1 of fn is "ΓÇö" then exit writeClipOut
  812.   set cursor to 4
  813.   if fn is not empty then
  814.     put cd field "HoldingArea" of cd "Help Card" into temp
  815.     if temp is empty then
  816.       answer return & "Cancelled:  There is nothing in the special clipboard."
  817.     else
  818.       open file fn
  819.       write temp to file fn
  820.       close file fn
  821.       clearClip
  822.       answer "Special clipboard written to file ΓÇ£" & fn & "ΓÇ¥ and special clipboard cleared."
  823.     end if
  824.   end if
  825. end writeClipOut
  826.  
  827. on writeOutByDate
  828.   set cursor to 4
  829.   put "Date Update From" into shortFile
  830.   put NewFileName( "Save file as:",(shortFile)) into upf
  831.   if upf is empty  or char 1 of upf is "ΓÇö" then exit writeOutByDate
  832.   put the short date into temp
  833.   ask "Enter last date to be included:" with temp
  834.   if it is empty then
  835.     exit writeOutByDate
  836.   else
  837.     put it into CutOff
  838.   end if
  839.   go to cd 2
  840.   open file upf
  841.   convert CutOff to dateItems
  842.  
  843.   repeat forever
  844.     set cursor to busy
  845.     put field "DateMade" into temp
  846.     convert temp to dateItems
  847.     if item 1 of temp >= item 1 of Cutoff and item 2 of temp >= item 2 of Cutoff and item 3 of temp >= item 3 of Cutoff then
  848.       write first line of field "Author" & return to file upf
  849.       write first line of field "Title" & return to file upf
  850.       write first line of field "Source" & return to file upf
  851.       write first line of field "Comments" & return to file upf
  852.       write first line of field "Keywords" & return to file upf
  853.       go next cd of this bkgnd
  854.     else
  855.       exit repeat
  856.     end if
  857.   end repeat
  858.   close file upf
  859.   convert CutOff to short date
  860.   answer return & "All articles entered on or after" && CutOff && "have been written to the file" && "ΓÇ£" & upf & "ΓÇ¥." with "Ok"
  861. end writeOutByDate
  862.  
  863. on writeOutNewArticles
  864.   set cursor to 4
  865.   put the number of cds of bkgnd id 30235 into numofcards
  866.   put "Status Update From" into shortFile
  867.   put NewFileName( "Save file as:",(shortFile)) into upf
  868.   if upf is empty or char 1 of upf is "ΓÇö" then exit writeOutNewArticles
  869.   open file upf
  870.   set cursor to busy
  871.   put "Find" && quote & "New" & quote && "in field" && quote & "Status" & quote
  872.   hide msg
  873.  
  874.   repeat forever
  875.     type return
  876.     if the result is not empty then
  877.       answer return & "All new articles have been written to the file" && "ΓÇ£" & upf & "ΓÇ¥." with "Ok"
  878.       close file upf
  879.       exit repeat
  880.     else
  881.       put "?" into bkgnd field "Status"
  882.       write first line of field "Author" & return to file upf
  883.       write first line of field "Title" & return to file upf
  884.       write first line of field "Source" & return to file upf
  885.       write first line of field "Comments" & return to file upf
  886.       write first line of field "Keywords" & return to file upf
  887.     end if
  888.   end repeat
  889.  
  890. end writeOutNewArticles
  891.